package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 通知消息类型: 1-商家-商户入驻申请，2-商家-补贴余额不足，3-经纪人-商家升级审核结果，4-经纪人-新推广订单，5-经纪人-提现审核结果，6-消费者-活动报名结果，
 * 7-商户-订单结算，8-商户-库存预警，9-商户-策划人解绑通知，10-商户-提现到账，11-商户-提现失败
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum NotifyMsgTypeEnum {

    BUSINESS_MERCHANT_ENTER_APPLY(1, "商户入驻申请"),
    BUSINESS_SUBSIDY_AMT_LESS(2, "补贴余额不足"),
    AGENT_BUSINESS_ENTER_AUDIT(3, "商家升级审核结果"),
    AGENT_NEW_ORDER(4, "新推广订单"),
    AGENT_WITHDRAWAL_AUDIT(5, "提现审核结果"),
    USER_ACTIVE_ORDER_RESULT(6, "活动报名结果"),
    MERCHANT_ORDER_SETTLE(7, "订单结算"),
    MERCHANT_STOCK_WARN(8, "库存预警"),
    MERCHANT_UNBIND_BUSINESS(9, "策划人解绑通知"),
    MERCHANT_WITHDRAWAL_SUCCESS(10, "提现到账"),
    MERCHANT_WITHDRAWAL_FAIL(11, "提现失败"),
    USER_ENROLL_ORDER_RETURN(12, "活动返现"),
    SUCCESSFUL_GROUP_BUY(13,"拼团成功"),
    FAILED_GROUP_BUY(14, "拼团失败"),
    FREE_GROUP_BUY(15, "拼团免单")
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    NotifyMsgTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static NotifyMsgTypeEnum typeOfValue(Integer value) {
        NotifyMsgTypeEnum[] values = NotifyMsgTypeEnum.values();
        for (NotifyMsgTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static NotifyMsgTypeEnum typeOfName(String name) {
        NotifyMsgTypeEnum[] values = NotifyMsgTypeEnum.values();
        for (NotifyMsgTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
